package com.singing.manager;

import com.singing.model.Command;

import java.util.ArrayList;
import java.util.List;

public class JudgesManager extends BaseManager {
    private static final int LIST = 1;

    // 歌手增删改
    private static final int ADD = 2;

    // 歌手增删改
    private static final int UPDATE = 3;

    // 歌手增删改
    private static final int REMOVE = 4;


    public JudgesManager(String title, ArrayList<Command> judgesCommandList) {
        super(title, judgesCommandList);
    }

    @Override
    protected int processCommand(int command) {
        switch (command) {
            case LIST:
                showJudgeList();
                break;
            case ADD:
                showAddJudge();
                break;
            case UPDATE:
                showUpdateJudge();
                break;
            case REMOVE:
                showRemoveJudge();
                break;
        }
        return command;
    }

    private void showJudgeList() {
        // TODO
        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "重新加载"));
        new JudgeListManager("裁判列表", commandList).manage();
    }

    private void showRemoveJudge() {
        // TODO

        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "重新加载"));
        commandList.add(new Command(2, "删除"));
        new JudgeRemoveManager("裁判删除", commandList).manage();
    }

    private void showUpdateJudge() {
        // TODO

        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "重新加载"));
        commandList.add(new Command(2, "修改"));
        new JudgeUpdateManager("裁判修改", commandList).manage();
    }

    private void showAddJudge() {
        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "输入裁判信息"));
        new JudgeAddManager("裁判添加", commandList).manage();
    }
}
